package com.feibi.hitutor.JPush;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.Log;

import cn.jpush.android.api.JPushInterface;

public class MyReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        Bundle bundle = intent.getExtras();
        String title = bundle.getString(JPushInterface.EXTRA_REGISTRATION_ID);
        Log.d("TAG", "initjpush-onReceive: "+title);
        SharedPreferences id = context.getSharedPreferences("id", Context.MODE_PRIVATE);
        id.edit().putString("id", title).commit();
    }
}
